package com.guoxin.chapter3.join.joinexception;

/**
 * @author guoxin
 * @date 2019年8月23日
 */
public class Run {

	public static void main(String[] args) throws InterruptedException {
		ThreadB threadB = new ThreadB();
		threadB.start();
		Thread.sleep(500);
		ThreadC threadC = new ThreadC(threadB);
		threadC.start();
		
		Thread [] threads = new Thread[Thread.currentThread().getThreadGroup().activeCount()];
		Thread.currentThread().getThreadGroup().enumerate(threads);
		for(int i=0;i<threads.length;i++){
			System.out.println(threads[i].getName()+"---"+threads[i].getState());
		}
	}

}
